/**
 * @author ItJianGe
 * @data 2024/8/8 17:17
 */
public class Egg extends MaterialDecoratorFood {

    private Food food;

    public Egg(Food food) {
        this.food = food;
    }

    @Override
    public String getDescription() {
        return "加一个鸡蛋是 2 元";
    }

    @Override
    public double cost() {
        System.out.println(this.getDescription());
        return food.cost() + 2;
    }
}
